import { request } from '@/utils'

export function updateRoadnet(data: any) {
  return request({
    url: '/transport-network/v1/update/',
    method: 'put',
    data
  })
}

export function createRoadnet(data: any) {
  return request({
    url: '/transport-network-data-fusion-requests/v1/create/',
    method: 'post',
    data
  })
}

export function openNowRoadnet(id: string) {
  return request({
    url: `/transport-network/v1/get-one/${id}`,
    method: 'get'
  })
}

export function deleteNowRoadnet(id: string | number) {
  return request({
    url: `/transport-network/v1/delete/${id}`,
    method: 'delete'
  })
}

export function mergeRoadnetPath(data: any) {
  return request({
    url: '/transport-network/v1/merge/',
    method: 'put',
    data
  })
}

export function getOptimalPath(data: any) {
  return request({
    url: '/tcs/routeComputationQueryByVehicleCode/',
    method: 'post',
    data
  })
}

// 导航下发
export function assignNavigationTask(code: string | number, objects: []) {
  return request({
    url: `/robot-cruise/patroling/${code}`,
    method: 'post',
    data: objects
  })
}

export function synchronousData() {
  return request({
    url: '/plant-model/v1/',
    method: 'put'
  })
}
